package com.cloudlead.fleetAction.action;

import com.cloudlead.common.lang.BusinessModule;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.fleetAction.BusinessModules;
import com.cloudlead.fleetAction.service.TbBankAccountEditSer;
import com.cloudlead.fleetService.vo.TbBankAccountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created by Jinnoo on 2015/8/13.
 */
@Controller
public class TbBankAccountEditActionFactory  extends AbstractActionFactory implements TbBankAccountEditSer{
    @Autowired
    TbBankAccountEditSer tbBankAccountEditSer;

    public TbBankAccountEditActionFactory() {super(BusinessModules.BankAccountEdit);}

    @Action
    @Order(1)
    @Label("增加公司账户")
    public void createBankAccount(TbBankAccountVo vo) {
        tbBankAccountEditSer.createBankAccount(vo);
    }

    @Action
    @Order(2)
    @Label("编辑公司账户")
    public void editBankAccount(TbBankAccountVo vo) {
        tbBankAccountEditSer.editBankAccount(vo);
    }

    @Action
    @Order(3)
    @Label("单值查询")
    public TbBankAccountVo findOneBankAccount(TbBankAccountVo tba) {
        return tbBankAccountEditSer.findOneBankAccount(tba);
    }

    @Action
    @Order(4)
    @Label("分页查询")
    public Page<TbBankAccountVo> findAllBankAccount(TbBankAccountVo tba, @Label("每页数量")int size, @Label("页码")int page) {
        return tbBankAccountEditSer.findAllBankAccount(tba,size,page);
    }

    @Action
    @Order(5)
    @Label("删除公司账户")
    public void delBankAccount(@Label("公司账户ID")String id) {
        tbBankAccountEditSer.delBankAccount(id);
    }
}
